package com.headcaselabs.lb.director;

import java.util.List;

import com.headcaselabs.lb.common.Record;
import com.headcaselabs.lb.common.Server;
/* 
Copyright 2007, HeadCase Humanufacturing, Inc.

	Licensed under the Apache License, Version 2.0 (the "License"); you
	may not use this file except in compliance with the License. You may
	obtain a copy of the License at
	
	   http://www.apache.org/licenses/LICENSE-2.0
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
	implied. See the License for the specific language governing
	permissions and limitations under the License.
*/
public interface LoadBalancedRecord {

	/**
	 * @return the lastUpdate
	 */
	public abstract long getLastUpdate();

	/**
	 * @param lastUpdate the lastUpdate to set
	 */
	public abstract void setLastUpdate(long lastUpdate);

	/**
	 * Recreates the pdns records for laodbalancing and selects a random node to server first.
	 * @param members
	 */
	public abstract void buildEntries(List<Server> members);

	//TODO: implement something besides RoundRobin
	public abstract Record next();

	/**
	 * @return the name
	 */
	public abstract String getName();

	/**
	 * @param name the name to set
	 */
	public abstract void setName(String name);

	/**
	 * @return the timestamp
	 */
	public abstract long getTimestamp();

	/**
	 * @param timestamp the timestamp to set
	 */
	public abstract void setTimestamp(long timestamp);

	/**
	 * @return the id
	 */
	public abstract int getId();

	/**
	 * @param id the id to set
	 */
	public abstract void setId(int id);

	public abstract List<Record> getRecords();

	public abstract void setRecords(List<Record> records);

}